package test;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import expression.*;

public class BrandonRomanoIPTest {

	//Postfix evaluator
	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void test1() 
	{
		String answer = InfixtoPostfixTranslator.eval("2 + 4");
		assertTrue(answer.equals("2 4 +"));
	}
	
	
	@Test
	public void test2() 
	{
		String answer = InfixtoPostfixTranslator.eval("2 ^ 2 ^ 2 ^ 2");
		assertTrue(answer.equals("2 2 2 2 ^ ^ ^"));
	}
	
	@Test
	public void test3() 
	{
		String answer = InfixtoPostfixTranslator.eval("2 * 3 + 1"); //eval("1 2 3 * +");
		assertTrue(answer.equals("2 3 * 1 +"));
	}
	
	@Test
	public void test4()
	{
		String answer = InfixtoPostfixTranslator.eval("1 * 28 ^ 2 * ( 6 / 3 + 2 )");
		assertTrue(answer.equals("1 28 2 ^ * 6 3 / 2 + *"));
	}
	
	@Test
	public void test5()
	{
		String answer = InfixtoPostfixTranslator.eval("( 1 + 8 ) * 8 * 2 ^ 8");
		assertTrue(answer.equals("1 8 + 8 * 2 8 ^ *"));
	}
	
}
